//
//  VistaCargando.m
//  Pico y placa
//
//  Created by DmpmMacPro on 21/01/13.
//  Copyright (c) 2013 Mario Franco. All rights reserved.
//

#import "VistaCargando.h"
#import "SessionManager.h"

@interface VistaCargando ()

@end

@implementation VistaCargando
@synthesize subvista1;
@synthesize spinner;
@synthesize btnCompartir;


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    //Es iPad
    if([[UIDevice currentDevice].model rangeOfString:@"iPad"].location != NSNotFound)
    {
        btnCompartir.hidden = YES;
        //scroller.contentSize = CGSizeMake([[UIScreen mainScreen] bounds].size.width*[principal.darFavoritos count], 747);
    }

    
    //Es iPhone 5
    if(CGSizeEqualToSize([[UIScreen mainScreen] preferredMode].size,CGSizeMake(640, 1136)))
    {
        CGRect containerRect = CGRectMake(0, 77, 320, 349);
        subvista1.frame = containerRect;
    }
    
    spinner.hidesWhenStopped = YES;
    [spinner startAnimating];    
    
	// Do any additional setup after loading the view.
}


- (void) viewDidAppear:(BOOL)animated
{
    SessionManager * principal = [SessionManager darInstancia];
    
    [principal actualizarTablasLocales];
    
    [principal cargarMundoPicoYPlaca];
    
    [spinner stopAnimating];
    
    [self performSegueWithIdentifier:@"inicioApp" sender:self];
    
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
